<%= error_messages_for 'article' %>


<!--[form:article]-->
<p>
    <label for="article_title">Title</label><br/>
    <%= text_field 'article', 'title', "cols" => "60", "rows" => "2"  %>
</p>

<p>
    <label for="article_source_author">Author</label><br/>
    <%= text_field 'article', 'author', "cols" => "60", "rows" => "1"  %>
</p>

<p>
    <label for="article_blurb">Blurb</label><br/>
    <%= text_area 'article', 'blurb', "cols" => "60", "rows" => "5"  %>
</p>

<p>
    <label for="article_body">Body</label><br/>
    <%= text_area 'article', 'body', "cols" => "60", "rows" => "30" %>
</p>

<h2>Preview</h2>
<!--Remove styles from here please!-->
<div id="preview" style="border-color:red;border-style:solid;border-width:1px"></div>

<%#AJAX stuff:%>

<%= 
observe_field(:article_body,
  :frequency => 0.5,
  :update    => :preview,   
  :url       => { :action => :preview_body }) 
%>



<%= 
   drop_receiving_element "article_body",
  :update => "article_body", :url => { :controller =>"images", :action => "get_url"},
  :accept=>"images",
  :loading => "Element.show('indicator')",
  :complete => "Element.hide('indicator'); text= '!'+ request.responseText +'!';insertAtCursor($('article_body'), text )" 
%>


<!--[eoform:article]-->
